//
//  GWUserInfoTool.m
//  新浪微博
//
//  Created by qianfeng on 16/2/18.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWUserInfoTool.h"
#import "GWHttpTool.h"
#import "MJExtension.h"
@implementation GWUserInfoTool
+(void)userInfoWithParame:(GWUserInfoParam *)pareme success:(void (^)(GWUserInforResult *))success failure:(void (^)(NSError *))failure
{
    [GWHttpTool get:@"https://api.weibo.com/2/users/show.json" parameters:pareme.keyValues success:^(id respondObj) {
        
        if (success) {
            GWUserInforResult *result =[GWUserInforResult objectWithKeyValues:respondObj];
            success(result);
        }
    } failure:^(NSError *error) {
        if (error) {
            failure(error);
        }
    }];
}

+(void)unreadCountWithParame:(GWUnReadCountParam *)pareme success:(void (^)(GWUnReadCountResult *))success failure:(void (^)(NSError *))failure
{
    [GWHttpTool get:@"https://rm.api.weibo.com/2/remind/unread_count.json" parameters:pareme.keyValues success:^(id respondObj) {
        
        if (success) {
            GWUnReadCountResult *result =[GWUnReadCountResult objectWithKeyValues:respondObj];
            success(result);
        }
    } failure:^(NSError *error) {
        if (error) {
            failure(error);
        }
    }];
}
@end
